<template>
  <!--  <el-carousel height="505px" :interval="3000" arrow="always">-->
  <!--    <el-carousel-item :key="key" v-for="item,key in banner_list">-->
  <!--      <a :href="item.link"><img :src="item" alt=""></a>-->
  <!--    </el-carousel-item>-->
  <el-carousel height="505px" :interval="2000" arrow="always">
    <el-carousel-item>
      <a><img src="../../../static/image/guai.jpg" alt=""></a>
      <a><img src="../../../static/image/bao.jpg" alt=""></a>
      <a><img src="../../../static/image/manYanXingXing.jpg" alt=""></a>

    </el-carousel-item>
    <el-carousel-item>
      <a><img src="../../../static/image/eat.jpeg" alt=""></a>
      <a><img src="../../../static/image/jiehunzheng.jpg" alt=""></a>

    </el-carousel-item>
    <el-carousel-item>
      <a><img src="../../../static/image/manYanXingXing.jpg" alt=""></a>
      <a><img src="../../../static/image/manYanXingXing.jpg" alt=""></a>
      <a><img src="../../../static/image/manYanXingXing.jpg" alt=""></a>

    </el-carousel-item>
  </el-carousel>
</template>

<script>
  export default {
    name: "Banner",
    data() {
      return {
        banner_list: [],
      }
    },
    created() {
      // 获取轮播图
      this.get_banner_list();
    },
    methods: {
      get_banner_list() {
        this.$axios.get(`${this.$settings.Host}/home/banner/`).then(response => {
          this.banner_list = response.data
        }).catch(error => {
          // this.$alert("轮播图获取失败")
        })
      }
    }
  }
</script>

<style scoped>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>
